#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, k ;
int a[N], peo[N], ans[N];

int main() {
	cin >> n >> k;
	for (int i = 0; i < n; ++i) {
		peo[i] = i + 1;
	}
	for (int i = 0; i < k; ++i) {
		int num;
		cin >> num;
		a[i] = num % (n - i);
	}
	for (int i = 0; i < k; ++i) {
		int lose;
		if (i == 0) {
			lose = 1;
			ans[i] = (lose + a[i]) % n;
			peo[lose + a[i]] = -1;
		} else {
			lose = ans[i - 1];
			for (int j = 0; j < a[i]; ++j) {
				if (peo[j] == -1) {
					j--;
				}
				if (j == a[i]) {
					ans[i] = (lose + a[i]) % n;
					peo[lose + a[i]] = -1;
				}
			}
		}
	}
	for (int i = 0; i < k; ++i) {
		cout << ans[i] << ' ';
	}
	return 0;
}